package cn.itcast.feign.clients;


import cn.itcast.feign.config.FeignDefaultConfiguration;
import cn.itcast.feign.pojos.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * Feign接口类：用来声明服务提供者的API接口信息
 */
@FeignClient(value = "userservice",configuration = FeignDefaultConfiguration.class)//括号里的值是服务提供者的服务名
public interface UserClient {

    /**
     * 根据id查询用户的接口
     * @param id
     * @return
     */
    @GetMapping("/user/{id}")
    public User queryById(@PathVariable("id") Long id);



}

